package leetcode_301_400;

import java.net.NetworkInterface;
import java.util.Stack;

public class LeeCode_334 {
    public static void main(String[] args) {

    }
    private static boolean increasingTriplet(int[] nums) {
        int n = nums.length;
        int[] maxes = new int[n];
        int max = Integer.MIN_VALUE;
        for (int i = n - 1; i >= 0; i--) {
            if (nums[i] > max){
                max = nums[i];
            }
            maxes[i] = max;
        }
        int min = Integer.MAX_VALUE;
        int[] mins = new int[n];
        for (int i = 0; i < nums.length; i++) {
            if (nums[i] < min){
                min = nums[i];
            }
            mins[i] = min;
        }
        for (int i = 0; i < n; i++) {
            if (nums[i] > mins[i] && nums[i] < maxes[i]){
                return true;
            }
        }
        return false;
    }
}
